<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>window对象</title>
		<script>
			//error:document-4.html:7 Uncaught TypeError: Cannot set properties of null (setting 'innerHTML')
			window.document.getElementById("timer").innerHTML=new Date().toLocaleString();		
			
		</script>
	</head>
	<body>
		<p id="timer"></p>
		
	</body>
</html>